home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / Sample Editors⁄Viewers / Text Editor / Source / TextEditorSemIntf.xh < prev    next >
Encoding:
Text File  |  1995-12-13  |  3.7 KB  |  164 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: Delta Quadrant:Source:OD:SampleCode:SOMTextEditor:Source:TextEditorSemIntf.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes defined in this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_TextEditorSemIntf_xh
  18. #define SOM_TextEditorSemIntf_xh
  19.  
  20. class TextEditorSemIntf;
  21.  
  22. #define TextEditorSemIntf_MajorVersion 0
  23. #define TextEditorSemIntf_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODSemanticInterface_xh
  31. #include <SemtIntB.xh>
  32. #endif
  33.  
  34. #ifndef TextEditorSemIntf_API
  35. #define TextEditorSemIntf_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODRefCntObject;
  50. class ODSemanticInterface;
  51. class ODSession;
  52. class ODPart;
  53. class ODDesc;
  54. class ODAppleEvent;
  55. class ODOSLToken;
  56. class TextEditorSemIntf;
  57.  
  58. /*
  59.  * End of user-defined types.
  60.  */
  61.  
  62. #ifdef OLDIBMSOMAPISUPPORT
  63. #define TextEditorSemIntfCClassData TextEditorSemIntfClassData
  64. #define TextEditorSemIntfNewClass(major,minor) somNewVersionedClassReference(TextEditorSemIntf,major,minor)
  65. #endif
  66.  
  67. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  68. #define TextEditorSemIntfMetaClass SOMClass
  69.  
  70.  
  71. /* The API to the TextEditorSemIntf class object, and the methods it introduces. */
  72. SOMEXTERN struct TextEditorSemIntfClassDataStructure {
  73. #ifdef OLDIBMSOMAPISUPPORT
  74.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  75. #else
  76.     long zero;
  77. #endif
  78.     somStaticClassInfo *sci;
  79.     somDToken        instanceDataToken;
  80.     long reserved [3];
  81.     somMToken RegisterTextension;
  82. } SOMDLINK TextEditorSemIntfClassData;
  83.  
  84. #if !defined(TextEditorSemIntf_Class_Source) && !defined(SOM_Module_texteditorsemintf_Source)
  85. #if PRAGMA_IMPORT_SUPPORTED
  86. #pragma import list TextEditorSemIntfClassData
  87. #endif
  88. #endif
  89.  
  90.  
  91. /*
  92.  * -- Typedefs and inline method declarations for left path inherited methods
  93.  * -- are omitted because this compilation had -museinheritedmethods in effect
  94.  */
  95.  
  96.  
  97. /*
  98.  * -- Typedefs for TextEditorSemIntf Method Procedures
  99.  */
  100. SOMEXTERN {
  101. typedef void   (* SOMLINK somTD_TextEditorSemIntf_RegisterTextension)(TextEditorSemIntf *somSelf, Environment *ev,
  102.         ODPtr textension);
  103. }
  104.  
  105. #endif /* TextEditorSemIntf_API */
  106.  
  107.  
  108. /*
  109.  * -- This emitter treats Method Tokens as Thunks by default.
  110.  * -- Use the sc modifier "nothunks" to change this default
  111.  */
  112. #undef somresolve_
  113. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  114.  
  115. /*
  116.  * -- The C++ Wrapper Class for TextEditorSemIntf
  117.  */
  118. class TextEditorSemIntf : public ODSemanticInterface
  119. {
  120. public:
  121.  
  122. // TextEditorSemIntf::new registers use of the class object, and then uses somNew
  123. // to allocate memory and load the object method table pointer. 
  124. void *operator new(size_t size)
  125. {
  126.     SOM_IgnoreWarning(size);
  127.     // Allocate memory using the default allocator for TextEditorSemIntf, and
  128.     // clear mem & set method table pointer, call basic initialization
  129. #ifdef SOMCHKNULL
  130.     void * __somResult = (void *)
  131.       somNewObject(TextEditorSemIntf);
  132.     SOMCHKNULL(__somResult);
  133.     return __somResult;
  134. #else
  135.     return (void*) somNewObject(TextEditorSemIntf);
  136. #endif
  137. }
  138.  
  139. // TextEditorSemIntf::delete uses the default deallocator for the object's class.
  140. void operator delete(void * obj)
  141. {
  142.     if (obj) {
  143.         SOM_Resolve(obj,SOMObject,somFree)
  144.            ( (SOMObject*) obj );
  145.     }
  146. }
  147.  
  148. /* method: RegisterTextension */
  149. void   RegisterTextension(Environment *ev,
  150.         ODPtr textension)
  151. {
  152.    SOM_ResolveD(this,TextEditorSemIntf,TextEditorSemIntf,RegisterTextension)
  153.     (this,ev,textension);
  154. #ifdef SOMCHKEXCEPT
  155.       SOMCHKEXCEPT;
  156. #endif
  157. }
  158.  
  159. };   /* TextEditorSemIntf */
  160.  
  161.  
  162.  
  163. #endif       /* SOM_TextEditorSemIntf_xh */
  164.